//
//  CodeView.swift 展示代码
//  swiftStudy
//
//  Created by Zhang on 2021/3/16.
//

import SwiftUI

struct CodeView: View {
    
    let code:String
    
    var body: some View {
        //横向滚动布局
        ScrollView(.horizontal){
            //文本
            Text(code).padding(20).font(.system(size: 18)).lineSpacing(10).frame(minWidth: 0, maxWidth: .infinity)
                .foregroundColor(codeColor)
        }
        .background(codeBgColor)
        .frame(minWidth: 0, maxWidth: .infinity).cornerRadius(15)//使控件横向填充屏幕
    }
}
